﻿<ion-header>
  <ion-navbar>
    <ion-title *ngIf="!isShowSearchbar">添加设备</ion-title>
    <ion-searchbar *ngIf="isShowSearchbar" (ionInput)="getItems($event)"></ion-searchbar>
    <ion-buttons *ngIf="!isShowSearchbar" end (click)="switchSearchbar()">
      <button ion-button icon-only>
        <ion-icon name='search'></ion-icon>
      </button>
    </ion-buttons>
  </ion-navbar>
</ion-header>
<ion-content>

  <div class="box" *ngFor="let item of items">
    <div class="vender-box">
      <div class="vender-name">{{item.vendername}}</div>
      <div class="device-box">
        <div class="device" *ngFor="let device of item.devices" (click)="gotoPage(device.deviceType)">
          <img src="assets/img/devices/{{device.image}}" onError="this.src='assets/img/devices/unknown.png'" />
          <div class="divice-name">{{device.name}}</div>
        </div>
      </div>
    </div>
  </div>
</ion-content>